﻿/**********************************************************************
* @file   FITKAcousticsFDiscNodeListAdaptor.h
* @brief  节点列表数据 读写适配器
* @author yangjing (1195810980@qq.com)
* @date   2025-02-25
*********************************************************************/
#ifndef _FITFK_ACOUSTICS_DISC_NODELIST_ADAPTOR_H___
#define _FITFK_ACOUSTICS_DISC_NODELIST_ADAPTOR_H___

#include "FITKAcousticsAbstractAdaptor.h"
#include "FITK_Kernel/FITKCore/FITKCoreMacros.h"
#include "FITK_Kernel/FITKAdaptor/FITKIOAdaptorFactory.h"
#include "FITK_Component/FITKAcousticsModel/FITKAcousticsDiscNodeList.h"
#include <H5Cpp.h>
namespace IO {
    class FITKHDF5FileTool;
    class FITKAcousticsDiscNodeList;
}
namespace IO
{
    class FITKAcousticsHDF5IOAPI FITKAcousticsFDiscNodeListAdaptor : public FITKAcousticsAbsAdaptor
    {
    public:
        explicit FITKAcousticsFDiscNodeListAdaptor() = default;
        virtual ~FITKAcousticsFDiscNodeListAdaptor() = default;

        virtual bool adaptR() override;

        virtual bool adaptW() override;
        
    private:

        /**
        * @brief 读节点列表到数据
        * @param @param[i]  gp hdf5组别
        * @param @param[i]  NodeList   离散模型节点列表 
        * @author yangjing (1195810980@qq.com)
        * @date 2024-1-5
        */
        bool readNodeList(H5::Group & gp, Acoustics::FITKAcousticsDiscNodeList * NodeListP);


        /**
        * @brief 写节点列表
        * @param @param[i]  gp       hdf5组别
        * @param @param[i]  data     节点列表数据
        * @author yangjing (1195810980@qq.com)
        * @date 2024-1-6
        */
        bool writeNodeList(H5::Group & gp, Acoustics::FITKAcousticsDiscNodeList * data);

    private:
        IO::FITKHDF5FileTool*m_toolp{ nullptr };
    };
    Register2FITKIOAdaptorFactory(FITKAcousticsHDF5, Acoustics::FITKAcousticsDiscNodeList, FITKAcousticsFDiscNodeListAdaptor);
}


#endif
